#ifndef __Thread_H__
#define __Thread_H__

#include "Noncopyable.hpp"
#include <pthread.h>

namespace wd
{

class Thread : Noncopyable
{
public:
    Thread();
    virtual ~Thread() {}

    void start();//启动一个子线程
    void join();//等待一个子线程运行结束

private:
    virtual void run()=0;

    //子线程入口函数
    static void * start_routine(void*);

private:
    pthread_t _pthid;//线程id
    bool _isRunning;//线程的状态是否在运行
};

}//end of namespace wd


#endif

